from selenium.webdriver.common.by import By

class CouponMyVoucherLocator:
    # My Voucher菜单
    my_voucher_menu = (By.CSS_SELECTOR, '[path="/work_bench/voucher/myVoucher"]')

    #bind voucher按钮
    bind_voucher_button = (By.XPATH, '//button//span[text() = "Bind Voucher"]')

    #绑定voucher的输入框
    bind_voucher_input = (By.XPATH, "//input[contains(@placeholder,'Please enter Voucher No..')]")

    #绑定voucher的ok按钮
    ok_button = (By.XPATH, '//button/span[text() = "OK"]')

    # My Voucher列表属性
    my_voucher_list_no = (By.XPATH, '//th[text() = "Voucher No."]')
    my_voucher_list_status = (By.XPATH, '//span[text() = "Status"]')
    my_voucher_list_template = (By.XPATH, '//th[text() = "Voucher Template"]')
    my_voucher_list_fixed_amount = (By.XPATH, '//th[text() = "Fixed Amount (IDR)"]')
    my_voucher_list_balance = (By.XPATH, '//th[text() = "Balance (IDR)"]')
    my_voucher_list_reuse = (By.XPATH, '//th[text() = "Reuse"]')
    # my_voucher_list_period = (By.XPATH, '//th[text() = "Validation Period (UTC+08:00)"]')
    my_voucher_list_period = (By.XPATH, '//th[contains(text(),"Validation Period")]')

    # 搜索框
    search_input = (By.XPATH, "//input[contains(@placeholder,'Voucher Template/voucher No.')]")
    # 搜索按钮
    search_button = (By.XPATH, "//button[contains(@class,'antd4-btn antd4-btn-default antd4-btn-icon-only antd4-input-search-button')]")

    # 第一个查询结果
    first_search_result = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[1]')
    # 第一个查询结果的voucher template的值
    first_search_result_voucher_template = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[3]')
    # 第一个查询结果的status的值
    first_search_result_status = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[2]')
    #查询结果的数据量
    search_result_num = (By.XPATH, "//li[contains(@class,'antd4-pagination-total-text')]")
    #状态筛选按钮
    status_filter_button = (By.XPATH, "//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')]")
    status_filter_valid_button = (By.XPATH, '(//input[contains(@class,"antd4-checkbox-input")])[1]')
    status_filter_exhausted_button = (By.XPATH, '(//input[contains(@class,"antd4-checkbox-input")])[2]')
    status_filter_expired_button = (By.XPATH, '(//input[contains(@class,"antd4-checkbox-input")])[3]')
    status_filter_ok_button = (By.XPATH, '//button[contains(@class,"antd4-btn antd4-btn-primary antd4-btn-sm")]//span[text()="OK"]')
    status_filter_reset_button = (By.XPATH, '//span[text()="Reset"]')

